#include "Http.hpp"
#include "HttpServer.hpp"
#include "Socket.hpp"

void Usage(const char *str)
{
    std::cout << "请输入：" << str << " 端口号" << std::endl;
}

std::string Test(std::string &str)
{
    return std::string();
}

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(0);
    }
    uint16_t port = std::stoi(argv[1]);
    EnableConsolseSyncStrategy();
    std::unique_ptr<Http> http =std::make_unique<Http>();
    std::unique_ptr<Server> ptr = std::make_unique<Server>(port, [&http](std::string&reqstr) -> std::string 
    {
        return http->HanderRequst(reqstr);
    });
    return 0;
}